package com.zn.util;

/**
 * Created by yinjiawei on 2018/7/20.
 */
public class CodeConvertName {
    public static String convert(String code){
        String name="";
        switch (code){
            case "IC":name="IC"; break;
            case "IF":name="IF"; break;
            case "IH":name="IH";break;
            case "T":name="十债";break;
            case "TF":name="五债";break;
            case "CF":name="郑棉";break;
            case "CY":name="棉纱";break;
            case "FG":name="玻璃";break;
            case "JR":name="粳稻";break;
            case "LR":name="晚籼";break;
            case "MA":name="郑醇";break;
            case "OI":name="菜油";break;
            case "PM":name="普麦";break;
            case "RI":name="早稻";break;
            case "RM":name="菜粕";break;
            case "RS":name="菜籽";break;
            case "SF":name="硅铁";break;
            case "SM":name="锰硅";break;
            case "SR":name="白糖";break;
            case "TA":name="PTA";break;
            case "WH":name="郑麦";break;
            case "ZC":name="郑煤";break;
            case "A":name="豆一";break;
            case "B":name="豆二";break;
            case "BB":name="胶板";break;
            case "C":name="玉米";break;
            case "CS":name="淀粉";break;
            case "FB":name="纤板";break;
            case "I":name="铁矿";break;
            case "J":name="焦炭";break;
            case "JD":name="鸡蛋";break;
            case "JM":name="焦煤";break;
            case "L":name="塑料";break;
            case "M":name="豆粕";break;
            case "P":name="棕榈油";break;
            case "PP":name="PP";break;
            case "V":name="PVC";break;
            case "Y":name="豆油";break;
            case "AG":name="白银";break;
            case "AL":name="铝";break;
            case "AU":name="黄金";break;
            case "BU":name="沥青";break;
            case "CU":name="铜";break;
            case "FU":name="燃油";break;
            case "HC":name="热卷";break;
            case "NI":name="镍";break;
            case "PB":name="铅";break;
            case "RB":name="螺纹";break;
            case "RU":name="橡胶";break;
            case "SN":name="锡";break;
            case "WR":name="线材";break;
            case "ZN":name="锌";break;
            case "SC":name="原油";break;
            case "AP":name="苹果";break;
            case "TS":name="二债";break;
            default:name="--";break;
        }
        return name;
    }

    public static void main(String[] args) {
        String code="ag1812";
        String goodsCode=code.replaceAll("[^a-z^A-Z]", "").toUpperCase();
        String instrument=code.substring(goodsCode.length());
        String instrumentName= CodeConvertName.convert(goodsCode)+instrument;
    }
}
